package nongchang.kuaijiecaifu.com.ncapp_android.ui.lifeshopfragment;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import nongchang.kuaijiecaifu.com.ncapp_android.R;
import nongchang.kuaijiecaifu.com.ncapp_android.common.fragment.BaseFragment;
import nongchang.kuaijiecaifu.com.ncapp_android.retrofit.good.JoinRecord;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.adapter.JoinRecordAdapter;

/**
 * Created by Administrator on 2016/3/11 0011.
 */
public class LifeShopJoinFragment extends BaseFragment {
    @BindView(R.id.list)
    RecyclerView mListView;
    private JoinRecordAdapter mAdapter;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_life_shop_raffle, container, false);
        return view;
    }
    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ButterKnife.bind(this, getView());
        mAdapter=new JoinRecordAdapter(getContext());
        mListView.setAdapter(mAdapter);
        load();
    }

    private void load() {
        List<JoinRecord> list =new ArrayList<>();
        JoinRecord item=new JoinRecord();
        item.name="小黄人";
        item.number=100005586;
        item.time=(long)1464859456*(long)1000;
        list.add(item);
        list.add(item);
        list.add(item);
        list.add(item);
        list.add(item);
        mAdapter.update(list);
    }
}
